package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionMapper;
import com.ruoyi.net.domain.ElementQosAction;
import com.ruoyi.net.service.IElementQosActionService;

/**
 * 网元-QOS配置-流行为Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionServiceImpl implements IElementQosActionService 
{
    @Autowired
    private ElementQosActionMapper elementQosActionMapper;

    /**
     * 查询网元-QOS配置-流行为
     * 
     * @param id 网元-QOS配置-流行为主键
     * @return 网元-QOS配置-流行为
     */
    @Override
    public ElementQosAction selectElementQosActionById(String id)
    {
        return elementQosActionMapper.selectElementQosActionById(id);
    }

    /**
     * 查询网元-QOS配置-流行为列表
     * 
     * @param elementQosAction 网元-QOS配置-流行为
     * @return 网元-QOS配置-流行为
     */
    @Override
    public List<ElementQosAction> selectElementQosActionList(ElementQosAction elementQosAction)
    {
        return elementQosActionMapper.selectElementQosActionList(elementQosAction);
    }

    /**
     * 新增网元-QOS配置-流行为
     * 
     * @param elementQosAction 网元-QOS配置-流行为
     * @return 结果
     */
    @Override
    public int insertElementQosAction(ElementQosAction elementQosAction)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosAction.getId())) {
            elementQosAction.setId(uuid);
        }
        elementQosAction.setCreateBy(SecurityUtils.getUsername());
        elementQosAction.setCreateTime(DateUtils.getNowDate());
        elementQosAction.setUpdateBy(SecurityUtils.getUsername());
        elementQosAction.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionMapper.insertElementQosAction(elementQosAction);
    }

    /**
     * 修改网元-QOS配置-流行为
     * 
     * @param elementQosAction 网元-QOS配置-流行为
     * @return 结果
     */
    @Override
    public int updateElementQosAction(ElementQosAction elementQosAction)
    {
        elementQosAction.setUpdateBy(SecurityUtils.getUsername());
        elementQosAction.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionMapper.updateElementQosAction(elementQosAction);
    }

    /**
     * 批量删除网元-QOS配置-流行为
     * 
     * @param ids 需要删除的网元-QOS配置-流行为主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionByIds(String[] ids)
    {
        return elementQosActionMapper.deleteElementQosActionByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为信息
     * 
     * @param id 网元-QOS配置-流行为主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionById(String id)
    {
        return elementQosActionMapper.deleteElementQosActionById(id);
    }
}
